package online.sixfish.common.eunmration;



import java.util.Arrays;
import java.util.List;

public enum QueProgramResultTypeEnum {
    COMPILE_FAIL(1,"编译失败"),
    NOT_PASS(2,"结果错误"),
    PASS(3,"通过");

    private final int code;
    private final String desc;

    QueProgramResultTypeEnum(int code, String description) {
        this.code = code;
        this.desc = description;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static QueProgramResultTypeEnum getByCode(int code) {
        for (QueProgramResultTypeEnum resultType : QueProgramResultTypeEnum.values()) {
            if (code == resultType.code) {
                return resultType;
            }
        }
        return null;
    }

    public static List<QueProgramResultTypeEnum> getAllResultTypes() {
        return Arrays.asList(QueProgramResultTypeEnum.values());
    }
}
